Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add detailed documentation #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add detailed documentation #45

wants to merge 1 commit into from

Conversation

tsreaper
Copy link
Contributor

This PR adds detailed documentation for the gateway, including the REST API documentation and an API usage example.


pprint.pprint(r.json())
# => {'status': 'CLOSED'}
```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can contribute with a curl guide if you want..I usually use curl to test such services

<td>string</td>
<td>Must be <code>CANCELED</code>.</td>
</tr>
</table>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this guide generated automatically? Maybe we can copy the Flink documentation approach (that generates this automatically) or we can add something like swagger one day

| EXPLAIN PLAN FOR ... | Show string-based explanation about AST and execution plan of the given statement |
| SELECT ... | Submit a Flink `SELECT` SQL job |
| INSERT INTO ... | Submit a Flink `INSERT INTO` SQL job |
| INSERT OVERWRITE ... | Submit a Flink `INSERT OVERWRITE` SQL job |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would mention that SHOW CURRENT CATALOG/DATABASE are available but marked as experimental/evolving for the moment

Copy link
Contributor

@godfreyhe godfreyhe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the great job @tsreaper , It's better we can use RestAPIDocGenerator to generate Rest API documentation, which could make this work easy to maintain.

@@ -0,0 +1,8 @@
# Flink SQL Gateway Documents

Welcome to the documentation page of Flink SQL gateway. We currently have the following documents available.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move them to top level README.md

'''
```

The result of a `INSERT` statement will be returned once the insertion finished (be aware that if you're inserting a never-ending stream, this API call will block forever unless the job is canceled).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this API call will always get empty result


pprint.pprint(r.json())
''' =>
{'next_result_uri': '/v1/sessions/8797639f35e1ed71b734c035e03e98da/jobs/b1719d4ea8f6d41a830d44918cd7e4d0/result/1',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

session id should be 918e6d1eff0c14228069edec25144022 (result of first example result)

</tr>
<tr>
<th>Row Count</th>
<td colspan="3">&ge;1</td>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

catalogs may be empty

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

catalogs will always be non empty, but tables and views can indeed be empty

<tr>
<td>change_flags</td>
<td>array of boolean</td>
<td><p>This field only appears for a streaming job result.</p><ul><li>If the i-th element is `true`, the i-th result row should be appended to the results of the job.</li><li>If the i-th element is `false`, the i-th result row should be retracted from the results of the job.</li></ul></td>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field only appears for a streaming select job result.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mark this as PublicEvolving, because flink-1.11 has updated this to RowKind

<tr>
<td>schema</td>
<td>varchar</td>
<td>A serialized JSON string of the schema of the specified table. See gateway's <a href="https://github.com/ververica/flink-sql-gateway/blob/master/src/main/java/com/ververica/flink/table/gateway/rest/result/TableSchemaUtil.java"><code>TableSchemaUtil</code></a> for detailed format.</td>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mark this as PublicEvolving, the result need to be discussed

</tr>
</table>

#### RESET
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RESET ALL

@fpompermaier
Copy link

Just another note: in the list of supported commands, I'll make a clear separation between commands that ends in a job execution and those that does not involve any interaction with the Flink cluster. I'd like to have this more clear when I started approaching to this project

@romainr romainr mentioned this pull request May 20, 2020
@yababer
Copy link

yababer commented Jun 22, 2021

We created a quick openapi 3.0.0 spec to speak to the rest interface for our use case. It would be better if that spec was part of the repo. And even better if it was served from the gateway. If it is of interest, we can create a pull request and upload it.

@fpompermaier
Copy link

We created a quick openapi 3.0.0 spec to speak to the rest interface for our use case. It would be better if that spec was part of the repo. And even better if it was served from the gateway. If it is of interest, we can create a pull request and upload it.

That's great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants